//
//  MyCollectCollectionViewCell.m
//  Qyer
//
//  Created by 赵宇 on 15/9/22.
//  Copyright (c) 2015年 赵宇. All rights reserved.
//

#import "MyCollectCollectionViewCell.h"
#define wid self.contentView.frame.size.width
#define hei self.contentView.frame.size.height
@implementation MyCollectCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.picView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, wid, hei)];
        [self.contentView addSubview:self.picView];
        
        UIImageView *backV = [[UIImageView alloc]initWithFrame:CGRectMake(0, hei/4, wid, hei/4*3)];
        [backV setImage:[UIImage imageNamed:@"backViewCell"]];
        [self.contentView addSubview:backV];
        
        self.cnnameLab = [[UILabel alloc]initWithFrame:CGRectMake(0, hei/3 , wid, hei/3)];
        self.cnnameLab.textAlignment = YES;
        self.cnnameLab.textColor = [UIColor whiteColor];
        [self.contentView addSubview:self.cnnameLab];
        
        self.ennameLab = [[UILabel alloc]initWithFrame:CGRectMake(0, hei/3*2, wid, hei/3)];
        self.ennameLab.textAlignment = YES;
        self.ennameLab.textColor = [UIColor whiteColor];
        [self.contentView addSubview:self.ennameLab];
        
    }
    return self;
}
-(void)setValueWithModel:(MyCollectModel *)mod
{
    NSURL *url = [NSURL URLWithString:mod.pic];
    [self.picView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"zhanweiPic"]];
    self.cnnameLab.text = mod.cnname;
    self.ennameLab.text = mod.enname;
}
@end
